package main.java.org.mapper;

import main.java.Exam.pojo.Entity.TeacherStudent;
import main.java.Exam.pojo.Entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StudentMapper {


    @Select("select * from tb_user where role_id=#{status}")
    List<User> getIdStudent(int status);

    @Select("select * from tb_user where userAccount=#{userAccount}")
    User getAccountUser(String userAccount);

    @Select("select * from tb_class_teacher where student_id=#{id}")
    List<TeacherStudent> getStdentIdScore(Long id);
    @Select("select past_time from tb_exam_time_record where user_id = #{userId} and test_id = #{testId} ORDER BY tb_exam_time_record.submit_time DESC LIMIT 1;  ")
    Integer getPastTimeByUserAndTest( Long userId,  Long testId);

}
